package util;

import java.lang.reflect.Field;

import javax.servlet.http.HttpServletRequest;

public class BeanUtil {
     public static Object fullBean(String beanclass,HttpServletRequest request){
    	 Object bean =null;
    	 try{
    	 Class clazz = Class.forName(beanclass);
    	 bean = clazz.newInstance();
    	 Field[] fs = clazz.getDeclaredFields();
    	 for (Field f : fs) {
			f.setAccessible(true);
			f.set(bean, request.getParameter(f.getName()));
			f.setAccessible(false);
		 }
    	 }catch (Exception e) {
		  e.printStackTrace();
		}
    	 return bean;
     }
}
